package com.ebelter.seneo.ui.fragments.bonddevices;

import android.text.TextUtils;
import android.widget.TextView;

import com.ebelter.btcomlib.utils.ViewUtils;
import com.ebelter.seneo.R;
import com.ebelter.seneo.ui.fragments.BaseFragment;


public class BondDeviceSuccessFragment extends BaseFragment {
    @Override
    protected int setLayoutResouceId() {
        return R.layout.bonddevicesuccess_fly;
    }


    TextView tv_ble_name_bound;
    TextView tv_ble_address_bound;
    @Override
    protected void initView() {
        tv_ble_name_bound = findViewById(R.id.tv_ble_name_bound);
        tv_ble_address_bound = findViewById(R.id.tv_ble_address_bound);
    }

    String[] nameAddress;
    public void setNameAddress(String[] checkBluetooth) {
        this.nameAddress = checkBluetooth;
        update();
    }

    @Override
    public void onResume() {
        super.onResume();
        update();
    }

    private void update(){
        if (nameAddress!=null){
            ViewUtils.setTextViewStr(tv_ble_name_bound,"Seneo Scale");
            ViewUtils.setTextViewStr(tv_ble_address_bound,nameAddress[0]);
        }
    }


    public String[] getNameAddress(){
        return nameAddress;
    }
}
